%head
  %title
    = (yield(:page_title).length > 0 ? yield(:page_title) : 'Makes agencies agile') + ' : easyBacklog'

  %meta{ :"http-equiv"=>"Content-Type", :content=>"text/html, charset=UTF-8" }
  %link{ :rel => 'icon', :type => 'image/png', :href => image_path('favicon.png') }

  = stylesheet_link_tag 'application', :media => 'all' if use_base_css?
  /[if lt IE 9]
    = stylesheet_link_tag 'ie_compatibility', :media => 'all'
    = javascript_include_tag 'ie_compatibility'

  = javascript_include_tag 'application' unless @dont_render_application_js.present?

  = yield(:head)

  - unless %w(test dev).include?(Rails.env)
    :javascript
      Exceptional.setHost('exceptional-api.heroku.com');
      Exceptional.setKey('#{Exceptional::Config.api_key}');

  - # Javascript library to simulate drag & drop re-ordering of lists and to fix :focus pseudo selector not working in Selenium / Capybara-webkit
  = javascript_include_tag 'test' if Rails.env.test? || Rails.env.development?
  - # set a App.environment to test so that RSpec & Cucumber can detect test mode through JS
  = javascript_include_tag 'test/test-env' if Rails.env.test?

  = csrf_meta_tag
  %link{ :rel=>'author', :href=>'/humans.txt' }

  - unless Rails.env.test?
    :javascript
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-11771751-3']);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
